-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(node): Add tracing support for AzureOpenAI #18281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat(node): Add tracing support for AzureOpenAI #18281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds tracing support for the Azure OpenAI client in addition to the existing OpenAI client support, resolving issue #18280.
Key Changes:
- Extended the OpenAI instrumentation to also patch
AzureOpenAIclient constructor - Added test coverage for Azure OpenAI client in both default and v6 test suites
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
packages/node/src/integrations/tracing/openai/instrumentation.ts |
Refactored patching logic to support both OpenAI and AzureOpenAI clients by extracting common wrapping logic into a reusable _patchClient method |
dev-packages/node-integration-tests/suites/tracing/openai/v6/test.ts |
Added test case for Azure OpenAI client with v6 OpenAI SDK |
dev-packages/node-integration-tests/suites/tracing/openai/v6/scenario-azure-openai.mjs |
Created test scenario that instantiates and uses AzureOpenAI client with mock server for v6 |
dev-packages/node-integration-tests/suites/tracing/openai/test.ts |
Added test case for Azure OpenAI client with default OpenAI SDK version |
dev-packages/node-integration-tests/suites/tracing/openai/scenario-azure-openai.mjs |
Created test scenario that instantiates and uses AzureOpenAI client with mock server |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/node/src/integrations/tracing/openai/instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/node/src/integrations/tracing/openai/instrumentation.ts
Outdated
Show resolved
Hide resolved
RulaKhaled
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks for contributing!
As an improvement, we soon will tweak this a little to allow users to differentiate between azure and vanilla openai, but this is fine for now.
I’m not sure how to move forward with this PR. There are what I believe to be random test failures. |
This pull request adds the support to Azure OpenAI client in addition to the existing support of the vanilla OpenAI client.
Fixes issue #18280